package com.yuexun.beilunpatient.ui.my.model.impl;

import com.yuexun.beilunpatient.base.BaseEntity;
import com.yuexun.beilunpatient.ui.my.api.FeedbakApi;
import com.yuexun.beilunpatient.ui.my.model.IFeedbackModel;
import com.yuexun.beilunpatient.utils.ApiUtil;

import java.util.Map;

import rx.Observable;

/**
 * Created by work-jx on 2016/8/4.
 */
public class FeedbackModel implements IFeedbackModel {
    private FeedbakApi api;

    //记录Log
//    private final Logger log = ProUtil.getLogger(LoginModel.class);

    public FeedbakApi ApiInstance() {
        if (api != null) {
            return api;
        } else {
            return ApiUtil.getInstance().createRetrofitApi(FeedbakApi.class);
        }
    }

    @Override
    public Observable<BaseEntity> createFeedback(Map<String, String> praise) {
        api = ApiInstance();
        return api.createFeedback(praise);
    }
}
